package unit6.extractMethod.init;

import unit6.extractMethod.Order;

import java.util.ArrayList;
import java.util.List;

public class Customer {

    String name;

    /**
     * 初始形态
     */
    void printOwing() {
        List<Order> orderList = new ArrayList<>();
        double outstanding = 0.0;

        System.out.println("***************************");
        System.out.println("****** Customer Owes ******");
        System.out.println("***************************");

        for (Order order : orderList) {
            outstanding += order.getAmount();
        }

        System.out.println("name:" + name);
        System.out.println("amount:" + outstanding);
    }

}
